package com.techthinker.dreamBuilder.Define;

import java.io.File;

import android.os.Environment;

public class Constant {
	// debug
	public static final String TAG_NAME = "com.techthinker.debug";

	// DatabaseHelper
	public static final int DB_VERSION = 1;
	public static final String DB_NAME = "dreambuilder";
	public static final String SQL_CREATE_DICTIONARY = "CREATE TABLE IF NOT EXISTS  \"dictionary\"([dictionary_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[name] varchar,[version] varchar,[description] varchar,[size] float,[listsNum] int,[wordsNum] int,[isNotebook] bit   );";
	public static final String SQL_CREATE_BOOKMARK = "CREATE TABLE IF NOT EXISTS  \"bookmark\"([bookmark_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[name] varchar,[dictionary_id] integer REFERENCES [dictionary] ([dictionary_id]),[word_id] integer REFERENCES [word] ([word_id]),[date] datetime   );";
	public static final String SQL_CREATE_LIST = "CREATE TABLE IF NOT EXISTS  \"list\"([list_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[dictionary_id] integer REFERENCES [dictionary] ([dictionary_id]),[list_num] int,[name] varchar,[wordsNum] int   );";
	public static final String SQL_CREATE_TASK = "CREATE TABLE IF NOT EXISTS  \"task\"([task_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[dictionary_id] integer REFERENCES [dictionary] ([dictionary_id]),[totalDays] int,[startDate] datetime,[listsPerDay] int,"
			+ "[wordsPerGroup] int,[groupsPerRound] int,[sort] int   );";
	public static final String SQL_CREATE_TEST = "CREATE TABLE IF NOT EXISTS  \"test\"([test_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[dictionary_id] integer REFERENCES [dictionary] ([dictionary_id]),[list_id] integer REFERENCES [list] ([list_id]),"
			+ "[wordFirst] bit,[zhExplain] bit,[lastNum] int,[totalNum] int,[accuracy] int,[date] datetime   );";
	public static final String SQL_CREATE_WORD_1 = "CREATE TABLE IF NOT EXISTS ";
	public static final String SQL_CREATE_WORD_2 = "\"([word_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[list_id] integer REFERENCES [list] ([list_id]) On Delete NO ACTION On Update NO ACTION,[spell] varchar,[pronunciation] varchar,"
			+ "[enExplain] varchar,[zhExplain] varchar,[detail] varchar,[rate] int,"
			+ "[notebook_id] integer REFERENCES [dictionary] ([dictionary_id]) On Delete NO ACTION On Update NO ACTION   );";
	public static final String SQL_CREATE_TESTDETAIL = "CREATE TABLE IF NOT EXISTS  \"testdetail\"([testdetail_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[testdetailNum] int,[test_id] integer REFERENCES [test] ([test_id]),[word_id] integer REFERENCES [word] ([word_id]),"
			+ "[confusion_1] integer REFERENCES [word] ([word_id]),[confusion_2] integer REFERENCES [word] ([word_id]),"
			+ "[confusion_3] integer REFERENCES [word] ([word_id]),[order] int,[answer] int,"
			+ "[notebook_id] integer REFERENCES [dictionary] ([dictionary_id])   );";
	public static final String SQL_CREATE_TRACE = "CREATE TABLE IF NOT EXISTS  \"trace\"([trace_id] integer PRIMARY KEY AUTOINCREMENT,"
			+ "[task_id] integer REFERENCES [task] ([task_id]) On Delete NO ACTION On Update NO ACTION,"
			+ "[dictionary_id] integer REFERENCES [dictionary] ([dictionary_id]) On Delete NO ACTION On Update NO ACTION,"
			+ "[trace_num] int,[startStep] int,[endStep] int,[lastStep] int,[date] datetime   );";
	public static final String SQL_DELETE_WORD = "DROP TABLE IF EXISTS ";

	// DictionaryDAL
	public static final String TABLE_DICTIONARY = "dictionary";
	// ListDAL
	public static final String TABLE_LIST = "list";
	// WordDAL
	public static final String TABLE_WORD = "\"word_";
	// BookDAL
	public static final String TABLE_BOOKMARK = "bookmark";
	// TaskDAL
	public static final String TABLE_TASK = "task";
	// TraceDAL
	public static final String TABLE_TRACE = "trace";
	// TestDAL
	public static final String TABLE_TEST = "test";
	// TestdetailDAL
	public static final String TABLE_TESTDETAIL = "testdetail";

	// GalleryFlow
	public static final int MAX_ROTATIONANGLE = 60;
	public static final int MAX_ZOOM = -100;
	public static final int GALLERY_CHILD_WITH = 180;
	public static final int GALLERY_CHILD_HIGHT = 240;
	public static final int REFLECTION_GAP = 1;
	public static final int CHILD_SPACE = -15;

	// TTSHelper
	public static final int MY_DATA_CHECK_CODE = 888;

	// XMLParser
	public static final String DEFAULT_SD_PATH = Environment
			.getExternalStorageDirectory().getAbsolutePath()
			+ File.separator
			+ "dream-builder" + File.separator;

	// HttpHelper
	public static final String SERVER_URL = "http://192.168.1.183:8080/dream-builder/";
	public static final String SERVER_DIC_FOLDER = "dictionaries/";
	public static final String SERVER_DIC_IMAGE_FOLDER = "dic_images/";
	public static final String SERVER_RESOURCE_NAME = "resources.xml";

	// ListAdapter
	public static final int LIST_ITEM_PER_PAGE = 12;
}